package engine.graphics.vfx
{
	import engine.loaders.*;
	
	public class RxWorldFXChain
	{
		private var m_name:String;
		private var m_chainParams:Vector.<RxWorldFXParams>;
		private var m_chainVFX:Vector.<RxWorldBaseFX>;
		
		public function RxWorldFXChain()
		{
			this.m_name = null;
			this.m_chainParams = null;
			this.m_chainVFX = null;
		}
		
		public function Spawn(param1:RxWorldFXManager, param2:RxLoader3D, param3:Number) : RxWorldFXChain
		{
			var _loc_6:int = 0;
			var _loc_7:RxWorldFXParams = null;
			var _loc_8:RxWorldBaseFX = null;
			if (this.m_chainParams == null)
			{
				return null;
			}
			var _loc_4:* = this.CreateInstance();
			this.CreateInstance().m_chainVFX = new Vector.<RxWorldBaseFX>;
			var _loc_5:* = _loc_4.m_chainParams.length;
			_loc_6 = 0;
			while (_loc_6 < _loc_5)
			{
				
				_loc_7 = _loc_4.m_chainParams[_loc_6];
				_loc_7.SetTimeScale(param3);
				_loc_8 = param1.Spawn(param2, _loc_7);
				if (_loc_8 != null)
				{
					_loc_4.m_chainVFX.push(_loc_8);
				}
				_loc_6++;
			}
			return _loc_4;
		}
		
		public function CreateInstance() : RxWorldFXChain
		{
			var _loc_1:* = new RxWorldFXChain();
			_loc_1.m_name = this.m_name;
			_loc_1.m_chainParams = this.m_chainParams;
			this.m_chainVFX = null;
			return _loc_1;
		}
		
		public function ParseFromXML(param1:XML) : void
		{
			var _loc_2:XML = null;
			var _loc_3:RxWorldFXParams = null;
			this.m_name = param1.@name;
			this.m_chainParams = new Vector.<RxWorldFXParams>;
			this.m_chainVFX = null;
			for each (_loc_2 in param1.params)
			{
				
				_loc_3 = new RxWorldFXParams(_loc_2);
				this.m_chainParams.push(_loc_3);
			}
			RxWorldFXManager.instance.RegisterChain(this.m_name, this);
		}
	}
}